home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0115_Russian Uppercase fuction.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  1.4 KB  |  43 lines

  1. {-----------------------------------------------}
  2. Function  LoCase(ch:Char):Char;
  3. { Convert Ch to the LOWER case with Russian specifications }
  4. var
  5.  
  6.   OutCH: Char;
  7.  
  8. begin
  9.    OutCh:=Ch;
  10.  
  11.    if (OutCh>='A') and (OutCh<='Z') then
  12.       OutCh:=Chr(Ord(Outch) + $20);       { Convert chars "A...Z" to "a...z"}
  13.    if (OutCh>=#128) and (OutCh<=#143) then
  14.       OutCh:=Chr(Ord(Outch) + $20);       { Convert the first portion
  15.                                             of Russian chars }
  16.    if (OutCh>=#144) and (OutCh<=#159) then
  17.       OutCh:=Chr(Ord(Outch) + $50);       { Convert the second portion of
  18.                                             of Russian chars }
  19.    if (OutCh=#240) then  OutCh:=#241;     { Convert Russian umlaut }
  20.  
  21.    Lower:=OutCh;
  22. end; { Lower }
  23.  
  24. {-----------------------------------------------}
  25. Function Upper(Ch:Char):Char;
  26. { Convert Ch to UPPER case with Russian specificatios }
  27.  
  28. var
  29.  
  30.   OutCH: Char;
  31.  
  32. begin
  33.   OutCh:=Ch;
  34.   if (Ch>='a') and (Ch<='z') then
  35.      OutCh:=Chr(Ord(Ch) - $20)           { convert "a...z" to "A...Z"}
  36.   else if (Ch>=#160) and (Ch<=#175) then
  37.      OutCh:=Chr(Ord(Ch) - $20)           { convert the first russian portion}
  38.   else if (Ch>='╥' {rus}) and (Ch<='╤') then
  39.      OutCh:=Chr(Ord(Ch) - $50)           { convert the second Russian portion}
  40.   else if (Ch=#241) then Ch:=#240;       { convert Russian umlaut }
  41.  Upper:=OutCh;
  42. end; { Upper }
  43.